package com.sokal.easycare.modules.service.entity;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sokal.easycare.common.persistence.DataEntity;

/**
 * 服务Entity
 * 
 * @author liliangdong
 * @version 2017-03-27
 */
public class SerAction extends DataEntity<SerAction> {

	private static final long serialVersionUID = 1L;
	private SerService serService; // 所属服务 父类
	private String name; // 动作名称
	private String unit; // 单位
	private String value; // 值
	private String type; // 类型

	public SerAction() {
		super();
	}

	public SerAction(String id) {
		super(id);
	}
	

	public SerAction(SerService serService){
		this.serService = serService;
	}

	@JsonIgnore
	public SerService getSerService() {
		return serService;
	}

	public void setSerService(SerService serService) {
		this.serService = serService;
	}

	@Length(min = 0, max = 255, message = "动作名称长度必须介于 0 和 255 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Length(min = 0, max = 255, message = "单位长度必须介于 0 和 255 之间")
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Length(min = 0, max = 255, message = "值长度必须介于 0 和 255 之间")
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	@Length(min = 0, max = 1, message = "类型长度必须介于 0 和 1 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

}